﻿using System;
using System.Runtime.InteropServices;
using UnityEngine;

namespace DA.AnimGraph {
    [StructLayout(LayoutKind.Explicit)]
    [Serializable]
    public struct Number {
        [FieldOffset(0), SerializeField] public int intValue;
        [FieldOffset(0)] public float floatValue;

        public static implicit operator Number(int value) {
            return new Number() { intValue = value };
        }
        public static implicit operator Number(float value) {
            return new Number() { floatValue = value };
        }
    }
}
